{% extends "../base.html" %}

{% block title %}下書き{% endblock %}

{% block content %}
<h2>下書き</h2>

{% if message %}
<div class="message">{{ message }}</div>
{% endif %}

<table id="inbox" class="list-table">
    <thead>
        <tr>
            <td>件名</td>
            <td>本文</td>
            <td>重要度</td>
            <td>作成日時</td>
        <tr>
    </thead>
    <tbody>
{% for pigeon in pigeons.object_list %}
        <tr>
            <td><a href="new?id={{ pigeon.key.id }}">{{ pigeon.subject|truncate:10|escape }}</a></td>
            <td><a href="new?id={{ pigeon.key.id }}">{{ pigeon.body|truncate:10|escape }}</a></td>
            <td><a href="new?id={{ pigeon.key.id }}" class="importance-{{ pigeon.importance|escape }}">{{ pigeon.importance|importance }}</a></td>
            <td title="{{ pigeon.post_at|tz|date:"y/m/d(D) H:i" }}"><a href="new?id={{ pigeon.key.id }}">{{ pigeon.post_at|timesince }}前</a></td>
        <tr>
{% endfor %}
    </tbody>
</table>

<div class="pagination">
    <span class="step-links">
        {% if pigeons.has_previous %}
            <a href="?page={{ pigeons.previous_page_number }}">previous</a>
        {% endif %}

        <span class="current">
            Page {{ pigeons.number }} of {{ pigeons.paginator.num_pages }}.
        </span>

        {% if pigeons.has_next %}
            <a href="?page={{ pigeons.next_page_number }}">next</a>
        {% endif %}
    </span>
</div>
{% endblock %}
